package com.bootdo.front.controller;

import com.bootdo.common.domain.AdvertisementDO;
import com.bootdo.common.domain.FileDO;
import com.bootdo.common.service.AdvertisementService;
import com.bootdo.common.service.FileService;
import com.bootdo.common.utils.HtmlText;
import com.bootdo.common.utils.StringUtils;
import com.bootdo.system.domain.CheckTypeDO;
import com.bootdo.system.domain.SceneryArticleDO;
import com.bootdo.system.service.CheckTypeService;
import com.bootdo.system.service.SceneryArticleService;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;
import javax.swing.text.html.HTML;
import java.util.*;

@Controller
public class FrontIndexController {

    private String prefix="/front";

    @Autowired
    private SceneryArticleService sceneryArticleService;

    @Autowired
    private AdvertisementService advertisementService;

    @Autowired
    private FileService fileService;

    @Autowired
    private CheckTypeService checkTypeService;

    /**
     * 首页
     * @param model
     * @return
     */
    @GetMapping("/")
    String toIndex(Model model) {
        //首页广告
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "1");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);
        //核心技术
        map.put("articleType","hxjs");
        List<SceneryArticleDO> articleList1 = sceneryArticleService.list(map);
        String hxjs = "";
        if(!CollectionUtils.isEmpty(articleList1)) {
            for(SceneryArticleDO data : articleList1) {
                if(StringUtils.equals("核心技术",data.getArticleTitle())) {
                    hxjs = data.getArticleContent();
                    break;
                }
            }
        }
        model.addAttribute("hxjs",hxjs);
        //解决方案
        map.put("articleType","jjfa");
        List<SceneryArticleDO> articleList2 = sceneryArticleService.list(map);
        String jjfa = "";
        List<SceneryArticleDO> articleList3 = new ArrayList<SceneryArticleDO>();
        if(!CollectionUtils.isEmpty(articleList2)) {
            for(SceneryArticleDO data : articleList2) {
                if(StringUtils.equals("解决方案",data.getArticleTitle())) {
                    jjfa = data.getArticleContent();
                }else {
                    data.setArticleContent(HtmlText.htmlText(data.getArticleContent()));
                    articleList3.add(data);
                }
            }
        }
        model.addAttribute("jjfa",jjfa);
        model.addAttribute("list3",articleList3);
        //核心技术
        map.put("articleType","hxjs");
        List<SceneryArticleDO> articleList5 = sceneryArticleService.list(map);
        model.addAttribute("list5",articleList5);
        //轮播位说明
        map.put("articleType","lbwsm");
        List<SceneryArticleDO> articleList4 = sceneryArticleService.list(map);
        if(!CollectionUtils.isEmpty(articleList4)) {
            model.addAttribute("lbwsm",articleList4.get(0));
        }else {
            model.addAttribute("lbwsm",new SceneryArticleDO());
        }
        return prefix + "/index";
    }

    /**
     * 产品中心
     * @param model
     * @return
     */
    @GetMapping("/front/productCenter")
    String toProductCenter(Model model) {
        //首页广告
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "1");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);
        //获取产品中心信息
        map.put("articleType", "cpzx");
        List<SceneryArticleDO> cpzxList = sceneryArticleService.list(map);
        model.addAttribute("cpzxList",cpzxList);
        //轮播位说明
        map.put("articleType","lbwsm");
        List<SceneryArticleDO> articleList4 = sceneryArticleService.list(map);
        if(!CollectionUtils.isEmpty(articleList4)) {
            model.addAttribute("lbwsm",articleList4.get(0));
        }else {
            model.addAttribute("lbwsm",new SceneryArticleDO());
        }
        //解决方案
        map.put("articleType","jjfa");
        List<SceneryArticleDO> articleList2 = sceneryArticleService.list(map);
        List<SceneryArticleDO> articleList3 = new ArrayList<SceneryArticleDO>();
        if(!CollectionUtils.isEmpty(articleList2)) {
            for(SceneryArticleDO data : articleList2) {
                if(!StringUtils.equals("解决方案",data.getArticleTitle())) {
                    articleList3.add(data);
                }
            }
        }
        model.addAttribute("list3",articleList3);
        //核心技术
        map.put("articleType","hxjs");
        List<SceneryArticleDO> articleList5 = sceneryArticleService.list(map);
        model.addAttribute("list5",articleList5);
        return prefix + "/productCenter";
    }

    /**
     * 技术核心
     * @param model
     * @return
     */
    @GetMapping("/front/technologyCore")
    String toTechnologyCore(Model model,String typeName) {
        //首页广告technologyCore
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "1");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);
        //轮播位说明
        map.put("articleType","lbwsm");
        List<SceneryArticleDO> articleList4 = sceneryArticleService.list(map);
        if(!CollectionUtils.isEmpty(articleList4)) {
            model.addAttribute("lbwsm",articleList4.get(0));
        }else {
            model.addAttribute("lbwsm",new SceneryArticleDO());
        }
        //解决方案
        map.put("articleType","jjfa");
        List<SceneryArticleDO> articleList2 = sceneryArticleService.list(map);
        List<SceneryArticleDO> articleList3 = new ArrayList<SceneryArticleDO>();
        if(!CollectionUtils.isEmpty(articleList2)) {
            for(SceneryArticleDO data : articleList2) {
                if(!StringUtils.equals("解决方案",data.getArticleTitle())) {
                    articleList3.add(data);
                }
            }
        }
        model.addAttribute("list3",articleList3);
        //核心技术
        map.put("articleType","hxjs");
        List<SceneryArticleDO> articleList5 = sceneryArticleService.list(map);
        if(StringUtils.isEmpty(typeName) && !CollectionUtils.isEmpty(articleList5)) {
            typeName = articleList5.get(0).getArticleTitle();
        }
        model.addAttribute("list5",articleList5);
        model.addAttribute("typeName",typeName);
        return prefix + "/technologyCore";
    }

    /**
     * 解决方案
     * @param model
     * @return
     */
    @GetMapping("/front/solution")
    String toSolution(Model model) {
        //首页广告
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "1");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);
        //轮播位说明
        map.put("articleType","lbwsm");
        List<SceneryArticleDO> articleList4 = sceneryArticleService.list(map);
        if(!CollectionUtils.isEmpty(articleList4)) {
            model.addAttribute("lbwsm",articleList4.get(0));
        }else {
            model.addAttribute("lbwsm",new SceneryArticleDO());
        }
        //解决方案
        map.put("articleType","jjfa");
        List<SceneryArticleDO> articleList2 = sceneryArticleService.list(map);
        List<SceneryArticleDO> articleList3 = new ArrayList<SceneryArticleDO>();
        if(!CollectionUtils.isEmpty(articleList2)) {
            for(SceneryArticleDO data : articleList2) {
                if(!StringUtils.equals("解决方案",data.getArticleTitle())) {
                    articleList3.add(data);
                }
            }
        }
        model.addAttribute("list3",articleList3);
        model.addAttribute("list",articleList3);
        //核心技术
        map.put("articleType","hxjs");
        List<SceneryArticleDO> articleList5 = sceneryArticleService.list(map);
        model.addAttribute("list5",articleList5);
        return prefix + "/solution";
    }

    /**
     * 新闻动态
     * @param model
     * @return
     */
    @GetMapping("/front/news")
    String toNews(Model model, HttpServletRequest request) {
        //首页广告
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "1");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);
        model.addAttribute("articleTitle",request.getParameter("articleTitle"));
        //轮播位说明
        map.put("articleType","lbwsm");
        List<SceneryArticleDO> articleList4 = sceneryArticleService.list(map);
        if(!CollectionUtils.isEmpty(articleList4)) {
            model.addAttribute("lbwsm",articleList4.get(0));
        }else {
            model.addAttribute("lbwsm",new SceneryArticleDO());
        }
        //解决方案
        map.put("articleType","jjfa");
        List<SceneryArticleDO> articleList2 = sceneryArticleService.list(map);
        List<SceneryArticleDO> articleList3 = new ArrayList<SceneryArticleDO>();
        if(!CollectionUtils.isEmpty(articleList2)) {
            for(SceneryArticleDO data : articleList2) {
                if(!StringUtils.equals("解决方案",data.getArticleTitle())) {
                    articleList3.add(data);
                }
            }
        }
        model.addAttribute("list3",articleList3);
        //核心技术
        map.put("articleType","hxjs");
        List<SceneryArticleDO> articleList5 = sceneryArticleService.list(map);
        model.addAttribute("list5",articleList5);
        return prefix + "/news";
    }

    /**
     * 新闻详情
     * @param model
     * @return
     */
    @GetMapping("/front/newsDetail")
    String toNewsDetail(Long id,Model model) {
        SceneryArticleDO sceneryArticleDO = sceneryArticleService.get(id,null);
        model.addAttribute("sceneryArticleDO",sceneryArticleDO);
        //首页广告
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "1");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);
        //轮播位说明
        map.put("articleType","lbwsm");
        List<SceneryArticleDO> articleList4 = sceneryArticleService.list(map);
        if(!CollectionUtils.isEmpty(articleList4)) {
            model.addAttribute("lbwsm",articleList4.get(0));
        }else {
            model.addAttribute("lbwsm",new SceneryArticleDO());
        }
        //解决方案
        map.put("articleType","jjfa");
        List<SceneryArticleDO> articleList2 = sceneryArticleService.list(map);
        List<SceneryArticleDO> articleList3 = new ArrayList<SceneryArticleDO>();
        if(!CollectionUtils.isEmpty(articleList2)) {
            for(SceneryArticleDO data : articleList2) {
                if(!StringUtils.equals("解决方案",data.getArticleTitle())) {
                    articleList3.add(data);
                }
            }
        }
        model.addAttribute("list3",articleList3);
        //核心技术
        map.put("articleType","hxjs");
        List<SceneryArticleDO> articleList5 = sceneryArticleService.list(map);
        model.addAttribute("list5",articleList5);
        return prefix + "/newsDetail";
    }

    /**
     * 轮播位说明详情
     * @param model
     * @return
     */
    @GetMapping("/front/lbwDetail")
    String toLbwDetail(Long id,Model model) {
        SceneryArticleDO sceneryArticleDO = sceneryArticleService.get(id,null);
        model.addAttribute("sceneryArticleDO",sceneryArticleDO);
        //首页广告
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "1");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);
        //解决方案
        map.put("articleType","jjfa");
        List<SceneryArticleDO> articleList2 = sceneryArticleService.list(map);
        List<SceneryArticleDO> articleList3 = new ArrayList<SceneryArticleDO>();
        if(!CollectionUtils.isEmpty(articleList2)) {
            for(SceneryArticleDO data : articleList2) {
                if(!StringUtils.equals("解决方案",data.getArticleTitle())) {
                    articleList3.add(data);
                }
            }
        }
        model.addAttribute("list3",articleList3);
        //核心技术
        map.put("articleType","hxjs");
        List<SceneryArticleDO> articleList5 = sceneryArticleService.list(map);
        model.addAttribute("list5",articleList5);
        return prefix + "/lbwDetail";
    }

    /**
     * 加入我们
     * @param model
     * @return
     */
    @GetMapping("/front/joinUs")
    String toJoinUs(Model model) {
        //获取公司简介
        SceneryArticleDO sceneryArticleDO = sceneryArticleService.get(null,"gsjs");
        if(null != sceneryArticleDO) {
            model.addAttribute("sceneryArticleDO",sceneryArticleDO);
        }else {
            model.addAttribute("sceneryArticleDO",new SceneryArticleDO());
        }
        //获取人才招聘
        SceneryArticleDO sceneryArticleDO1 = sceneryArticleService.get(null,"rczp");
        if(null != sceneryArticleDO1) {
            model.addAttribute("sceneryArticleDO1",sceneryArticleDO1);
        }else {
            model.addAttribute("sceneryArticleDO1",new SceneryArticleDO());
        }
        //首页广告
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "1");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);
        //轮播位说明
        map.put("articleType","lbwsm");
        List<SceneryArticleDO> articleList4 = sceneryArticleService.list(map);
        if(!CollectionUtils.isEmpty(articleList4)) {
            model.addAttribute("lbwsm",articleList4.get(0));
        }else {
            model.addAttribute("lbwsm",new SceneryArticleDO());
        }
        //解决方案
        map.put("articleType","jjfa");
        List<SceneryArticleDO> articleList2 = sceneryArticleService.list(map);
        List<SceneryArticleDO> articleList3 = new ArrayList<SceneryArticleDO>();
        if(!CollectionUtils.isEmpty(articleList2)) {
            for(SceneryArticleDO data : articleList2) {
                if(!StringUtils.equals("解决方案",data.getArticleTitle())) {
                    articleList3.add(data);
                }
            }
        }
        model.addAttribute("list3",articleList3);
        //核心技术
        map.put("articleType","hxjs");
        List<SceneryArticleDO> articleList5 = sceneryArticleService.list(map);
        model.addAttribute("list5",articleList5);
        return prefix + "/joinUs";
    }

    /**
     * 在线检测
     * @param model
     * @return
     */
    @GetMapping("/front/onlineCheck")
    String toOnlineCheck(Model model) {
        //在线检测首页轮播图
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "2");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);

        //获取检测信息
        List<CheckTypeDO> checkTypeList = checkTypeService.list(map);
        model.addAttribute("checkTypeList",checkTypeList);
        return prefix + "/onlineCheck";
    }

    /**
     * 视频人脸检测
     * @param model
     * @return
     */
    @GetMapping("/front/faceCheckVideo")
    String toFaceCheckVideo(Model model) {
        //在线检测首页轮播图
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "2");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);

        //获取检测信息
        List<CheckTypeDO> checkTypeList = checkTypeService.list(map);
        model.addAttribute("checkTypeList",checkTypeList);

        return prefix + "/faceCheckVideo";
    }

    /**
     * 视频台标检测
     * @param model
     * @return
     */
    @GetMapping("/front/taiBiaoCheckVideo")
    String toTaiBiaoCheckVideo(Model model,String bizid) {
        //在线检测首页轮播图
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "2");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);

        //获取检测信息
        List<CheckTypeDO> checkTypeList = checkTypeService.list(map);
        model.addAttribute("checkTypeList",checkTypeList);

        String bizidName = "台标检测";
        map.put("bizid",bizid);
        List<CheckTypeDO> list = checkTypeService.list(map);
        if(!CollectionUtils.isEmpty(list)) {
            bizidName = list.get(0).getName();
        }
        model.addAttribute("bizidName",bizidName);
        model.addAttribute("bizid",bizid);

        return prefix + "/taiBiaoCheckVideo";
    }

    /**
     * 视频色情检测
     * @param model
     * @return
     */
    @GetMapping("/front/sexCheckVideo")
    String toSexCheckVideo(Model model) {
        //在线检测首页轮播图
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "2");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);

        //获取检测信息
        List<CheckTypeDO> checkTypeList = checkTypeService.list(map);
        model.addAttribute("checkTypeList",checkTypeList);

        return prefix + "/sexCheckVideo";
    }

    /**
     * 视频场景分割
     * @param model
     * @return
     */
    @GetMapping("/front/sceneCheckVideo")
    String toSceneCheckVideo(Model model) {
        //在线检测首页轮播图
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "2");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);

        //获取检测信息
        List<CheckTypeDO> checkTypeList = checkTypeService.list(map);
        model.addAttribute("checkTypeList",checkTypeList);

        return prefix + "/sceneCheckVideo";
    }

    /**
     * 少样本目标检测视频
     * @param model
     * @return
     */
    @GetMapping("/front/demoCheckVideo")
    String toDemoCheckVideo(Model model) {
        //在线检测首页轮播图
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "2");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);

        //获取检测信息
        List<CheckTypeDO> checkTypeList = checkTypeService.list(map);
        model.addAttribute("checkTypeList",checkTypeList);

        return prefix + "/demoCheckVideo";
    }

    /**
     * 声音色情检测
     * @param model
     * @return
     */
    @GetMapping("/front/sexCheckVoice")
    String toSexCheckVoice(Model model) {
        //在线检测首页轮播图
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "2");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);

        //获取检测信息
        List<CheckTypeDO> checkTypeList = checkTypeService.list(map);
        model.addAttribute("checkTypeList",checkTypeList);

        return prefix + "/sexCheckVoice";
    }

    /**
     * 声音语种检测
     * @param model
     * @return
     */
    @GetMapping("/front/languageCheckVoice")
    String toLanguageCheckVoice(Model model,String bizid) {
        //在线检测首页轮播图
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "2");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);

        //获取检测信息
        List<CheckTypeDO> checkTypeList = checkTypeService.list(map);
        model.addAttribute("checkTypeList",checkTypeList);

        String bizidName = "台标检测";
        map.put("bizid",bizid);
        List<CheckTypeDO> list = checkTypeService.list(map);
        if(!CollectionUtils.isEmpty(list)) {
            bizidName = list.get(0).getName();
        }
        model.addAttribute("bizidName",bizidName);
        model.addAttribute("bizid",bizid);

        return prefix + "/languageCheckVoice";
    }

    /**
     * 图片人脸检测
     * @param model
     * @return
     */
    @GetMapping("/front/faceCheckImage")
    String toFaceCheckImage(Model model) {
        //在线检测首页轮播图
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "2");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);

        //获取检测信息
        List<CheckTypeDO> checkTypeList = checkTypeService.list(map);
        model.addAttribute("checkTypeList",checkTypeList);

        return prefix + "/faceCheckImage";
    }

    /**
     * 图片色情检测
     * @param model
     * @return
     */
    @GetMapping("/front/sexCheckImage")
    String toSexCheckImage(Model model) {
        //在线检测首页轮播图
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "2");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);

        //获取检测信息
        List<CheckTypeDO> checkTypeList = checkTypeService.list(map);
        model.addAttribute("checkTypeList",checkTypeList);

        return prefix + "/sexCheckImage";
    }

    /**
     * 图片台标检测
     * @param model
     * @return
     */
    @GetMapping("/front/taiBiaoCheckImage")
    String toTaiBiaoCheckImage(Model model,String bizid) {
        //在线检测首页轮播图
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "2");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);

        //获取检测信息
        List<CheckTypeDO> checkTypeList = checkTypeService.list(map);
        model.addAttribute("checkTypeList",checkTypeList);

        String bizidName = "台标检测";
        map.put("bizid",bizid);
        List<CheckTypeDO> list = checkTypeService.list(map);
        if(!CollectionUtils.isEmpty(list)) {
            bizidName = list.get(0).getName();
        }
        model.addAttribute("bizidName",bizidName);
        model.addAttribute("bizid",bizid);

        return prefix + "/taiBiaoCheckImage";
    }

    /**
     * 少样本目标检测图片
     * @param model
     * @return
     */
    @GetMapping("/front/demoCheckImage")
    String toDemoCheckImage(Model model) {
        //在线检测首页轮播图
        Map<String,Object> map = new HashMap<String, Object>();
        //advSiteCode
        map.put("advCode", "2");
        AdvertisementDO advertisementDO = advertisementService.getAdvertisementDetail(map);
        List<FileDO> advImageList = new ArrayList<FileDO>();
        if(null != advertisementDO && StringUtils.isNotEmpty(advertisementDO.getAttachId())) {
            advImageList = fileService.queryListByAttachId(advertisementDO.getAttachId());
        }
        model.addAttribute("advImageList",advImageList);

        //获取检测信息
        List<CheckTypeDO> checkTypeList = checkTypeService.list(map);
        model.addAttribute("checkTypeList",checkTypeList);

        return prefix + "/demoCheckImage";
    }

}
